<%@ page language="java" contentType="text/html;  charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>

<div class="question-container">				
				<div class="question-content"
					style="border-radius: 5px; box-shadow: lightblue 1px 1px 1px 1px; margin: 40px 0 30px 0;">
					<span style="margin-left: -25px;">问卷说明:</span><br>
					${survey.remark}
				</div>
					<c:forEach items="${survey.question}" var="item">
						<div class="question-content" style="padding-left:10px;margin-top:20px;"> 
						<c:if test="${isAuthor=='Y'}">
							<c:if test="${item.questionType==1 or item.questionType==2}">
									<input type="checkbox" name="checkbox" value="${item.questionOrder}" content="${item.questionContent}" style="width: 30px;" />
							</c:if>
							<c:if test="${item.questionType!=1 and item.questionType!=2}">
									<input type="checkbox" name="checkbox" style="width: 1px; visibility: hidden;" />
							</c:if>
						</c:if>
						
						${item.questionOrder}.${item.questionContent} 
						</div>
						<c:if test="${item.questionType==1 or item.questionType==2}">
							<c:forEach items="${item.questionOptionList}" var="itema" varStatus="list">
								<div>&nbsp;&nbsp;&nbsp;&nbsp;
									${itema.optionValue}.${itema.optionName}</div>
								<div id="bar_${list.index}" style="width: 1px; height: 20px; background-color: lightblue; float: left; margin-left: 30px;"
									opwidth="${itema.width}"></div>
								<span style="font-size: 18px; font-weight: 200; line-height: 30px; height: 20px;">&nbsp;${itema.percent},&nbsp;[${itema.count}票]</span>
							</c:forEach>
						</c:if>
						
						<c:if test="${item.questionType ==3 or item.questionType ==4}">
							<input type="text" disabled="disabled" value="文本域或文本框">
						</c:if>
						  
						
						<c:if test="${item.questionType==5}">									 
							<c:forEach items="${item.questionOptionList}" var="itema" varStatus="list">
									<div>&nbsp;&nbsp;&nbsp;&nbsp; [${itema.rule}]</div>
									<div id="bar_${list.index}"
										style="width: 80px; height: 20px; background-color: lightblue; float: left; margin-left: 30px;"
										opwidth="${itema.width}"></div>
									<span
										style="font-size: 18px; font-weight: 200; line-height: 30px; height: 20px;">
										&nbsp;${itema.percent},&nbsp;[${itema.count}票]</span>
							</c:forEach>
						</c:if>
						
						<c:if test="${item.questionType==6}">										 
							<c:forEach items="${item.questionOptionList}" var="itema" varStatus="list">
								<div>&nbsp;&nbsp;&nbsp;&nbsp;
									${itema.optionValue=="0"?"2":"1"}.${itema.optionName}</div>
								<div id="bar_${list.index}"
									style="width: 1px; height: 20px; background-color: lightblue; float: left; margin-left: 30px;"
									opwidth="${itema.width}"></div>
								<span
									style="font-size: 18px; font-weight: 200; line-height: 30px; height: 20px;">&nbsp;${itema.percent},&nbsp;[${itema.count}票]</span>
							</c:forEach>
						</c:if>
				</c:forEach>
						 

					<div>
						<div style="text-align: center;magrin-top:20px;">
							<c:if test="${isAuthor=='Y'}">
								<div class="toolButton"  id="button">组合统计</div>
								
								</c:if>
							<div class="toolButton divButton" id="button6">返回</div>
						</div>
					</div>
				</div>
				
<script>
//显示百分比宽度
	var bars = $("div[id^='bar_']");
	$.each(bars, function (n) 
	{
	    $(this).show(function () 
	    {
	        var mywidth = Number($(this).attr("opwidth")) * 500 + "px";
	        $(this).animate(
	        {
	            width: mywidth
	        }
	            , 500, null, function ()
	        {
	            var divId = $(this).attr("id") + "_data";
	            console.log($(divId))
	            $(divId).show();
	        });
	    });
	});
</script>
<script type="text/javascript" src="${ctx}/res/js/survey/surveyStatistics/surveyResultStatistics.js"></script>